using LiJ.Common.Extention;

namespace LiJ.Pay.WeiXin.Coupon.Mos
{
	/// <summary>
	///   发送代金券响应实体
	/// </summary>
	public class WxPaySendConpouResp : WxPayBaseResp
	{
		/// <summary>   
		///    设备号 可空 String(32) 微信支付分配的终端设备号
		/// </summary>  
		public string device_info
		{
			get;
			set;
		}

		/// <summary>   
		///    代金券批次id 必填 String 用户在商户appid下的唯一标识
		/// </summary>  
		public string coupon_stock_id
		{
			get;
			set;
		}

		/// <summary>   
		///    返回记录数 必填 Int 返回记录数
		/// </summary>  
		public int resp_count
		{
			get;
			set;
		}

		/// <summary>   
		///    成功记录数 必填 Int 成功记录数
		/// </summary>  
		public int success_count
		{
			get;
			set;
		}

		/// <summary>   
		///    失败记录数 必填 Int 失败记录数
		/// </summary>  
		public int failed_count
		{
			get;
			set;
		}

		/// <summary>   
		///    用户标识 必填 String 用户在商户appid下的唯一标识
		/// </summary>  
		public string openid
		{
			get;
			set;
		}

		/// <summary>   
		///    返回码 必填 String 返回码，SUCCESS/FAILED
		/// </summary>  
		public string ret_code
		{
			get;
			set;
		}

		/// <summary>   
		///    代金券id 必填 String 对一个用户成功发放代金券则返回代金券id，即ret_code为SUCCESS的时候； 如果ret_code为FAILED则填写空串""
		/// </summary>  
		public string coupon_id
		{
			get;
			set;
		}

		/// <summary>   
		///    返回信息 必填 String 返回信息，当返回码是FAILED的时候填写，否则填空串“”
		/// </summary>  
		public string ret_msg
		{
			get;
			set;
		}

		protected override void FormatPropertiesFromMsg()
		{
			base.FormatPropertiesFromMsg();
			this.device_info = base["device_info"];
			this.coupon_stock_id = base["coupon_stock_id"];
			this.resp_count = base["resp_count"].ToInt32(0);
			this.success_count = base["success_count"].ToInt32(0);
			this.failed_count = base["failed_count"].ToInt32(0);
			this.openid = base["openid"];
			this.ret_code = base["ret_code"];
			this.coupon_id = base["coupon_id"];
			this.ret_msg = base["ret_msg"];
		}
	}
}
